import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

// 使用路由懒加载技术
const routes = [{
        path: '/home',
        name: 'home',
        component: () =>
            import ('../views/1.home.vue'),
        children: [{
                path: "/er1",
                name: "er1",
                component: () =>
                    import ('../views/hometop/er1.vue'),
            },
            {
                path: "/er2",
                name: "er2",
                component: () =>
                    import ('../views/hometop/er2.vue'),
            },
            {
                path: "/er3",
                name: "er3",
                component: () =>
                    import ('../views/hometop/er3.vue'),
            },
            {
                path: "/",
                redirect: "/er1"
            }
        ]
    }, {
        path: '/shan',
        name: 'shan',
        component: () =>
            import ('../views/2.shan.vue')
    }, {
        path: '/huati',
        name: 'huati',
        component: () =>
            import ('../views/3.huati.vue'),
        children: [{
            path: "/tuijian",
            name: "tuijian",
            component: () =>
                import ("../views/huatipage/page1.vue")
        }, {
            path: "/xinshidai",
            name: "xinshidai",
            component: () =>
                import ("../views/huatipage/page2.vue")
        }, {
            path: "/shipin",
            name: "shipin",
            component: () =>
                import ("../views/huatipage/page3.vue")
        }, {
            path: "/redian",
            name: "redian",
            component: () =>
                import ("../views/huatipage/page4.vue")
        }, {
            path: "/junshi",
            name: "junshi",
            component: () =>
                import ("../views/huatipage/page5.vue")
        }, {
            path: "/",
            redirect: "/tuijian"
        }]
    }, {
        path: '/zhen',
        name: 'zhen',
        component: () =>
            import ('../views/4.zhen.vue'),
        children: [{
            path: "/shouye",
            name: "shouye",
            component: () =>
                import ("../views/zhenpage/shouye.vue")
        }, {
            path: "/tansuo",
            name: "tansuo",
            component: () =>
                import ("../views/zhenpage/tansuo.vue")
        }, {
            path: "/",
            redirect: "/shouye"
        }]
    }, {
        path: '/wode',
        name: 'wode',
        component: () =>
            import ('../views/5.wode.vue')
    }, {
        path: '/shezhi',
        name: 'shezhi',
        component: () =>
            import ('../views/6.shezhi.vue')
    }, {
        path: '/shandetails',
        name: 'shandetails',
        component: () =>
            import ('../views/7.shandetails.vue')
    }, {
        path: '/login',
        name: 'login',
        component: () =>
            import ('../views/8.login.vue')
    }, {
        path: '/regist',
        name: 'regist',
        component: () =>
            import ('../views/9.regist.vue')
    },
    { path: "/", redirect: "/home" },
    {
        path: "/*",
        name: "no404",
        component: () =>
            import ("../views/10.no404.vue")
    }
]

const router = new VueRouter({
    // mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router